from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
import time

testCase = "DBshop0016_商品管理管理分类前台侧边设置删除"

firefox = openBrowser(urlAdmin) #打开后台网页
DBshopLoginAdmin(firefox)   #后台登录
DBshopEnterMenu3(firefox,"商品管理","管理分类","前台侧边设置")

# 1.点击“删除”按钮，确定删除，删除成功。
firefox.find_element_by_xpath('//td[contains(.,"网站很好看")]/following-sibling::td[3]/a[2]').click()
firefox.switch_to.alert.accept()
time.sleep(3)
try:
    firefox.find_element_by_xpath('//td[contains(.,"网站很好看")]').is_displayed()
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()